import React, { Component } from 'react'
import Product from '@/components/Product'
import './home.css'
import {getRecommendApi} from '@/api/home'
export default class Home extends Component {
constructor(){
    super()
    this.state={
        list:[]
    }
}
//获取首发新品数据
fetchRecommend=()=>{
    getRecommendApi({page:1,limit:20}).then(res=>{
        this.setState({
            list:res.data.data.list
        })
    })
}
componentDidMount(){
    this.fetchRecommend()
}  
render() {
    return (
      <div>
        {/* 在此处完成商品列表的显示 */}
         <div className='container'>
            {/* {
                this.state.list.map((item,index)=><Product key={index} {...item}></Product>)
            } */}
            <Product 
                // store_name="兰蔻香水兰蔻香水兰蔻香水兰蔻香水"
                price={1000}
                ot_price={1500}
                sex="男"></Product>
         </div>
      </div>
    )
  }
}
